requirejs.config({
	baseUrl: 'http://localhost/website/ershouceh/ershouche/js/',
	paths: {
		jquery: "jquery.min",
		"jquery.placeholder": "jquery.placeholder.min",
		"jquery.scroll2Top": "jquery.scroll2Top.min",
		"jquery.lazyload": "jquery.lazyload.min",
		"jquery.stickUp": "jquery.stickup.min",
		"jquery.fullscreen": "jquery.fullscreen.min",
		"jquery.owlCarousel": "owl.carousel.min",
		bootstrap: "bootstrap.min",
		app: "app-09ee281e.js".replace(/\.js/, "")
	},
	shim: {
		jquery: {
			exports: "$"
		},
		"jquery.lazyload": {
			deps: ["jquery"]
		},
		"jquery.stickUp": {
			deps: ["jquery"]
		},
		"jquery.fullscreen": {
			deps: ["jquery"]
		},
		"jquery.owlCarousel": {
			deps: ["jquery"]
		},
		"jquery.scroll2Top": {
			deps: ["jquery"]
		},
		"jquery.placeholder": {
			deps: ["jquery"]
		},
		bootstrap: {
			deps: ["jquery"]
		}
	}
}), require(["jquery"], function($) {
	$("#schedule_button, #schedule_navbar_button").on("click", function() {
		$("#schedule_modal").fullscreen({
			backdrop: "static",
			show: !0
		})
	}),
	$("#schedule_button1, #schedule_navbar_button").on("click", function() {
		$("#schedule_modal1").fullscreen({
			backdrop: "static",
			show: !0
		})
	})
	, $("#schedule_mobile_number").on("focus", function() {
		$(this).data("editing", "true")
	}).on("change", function() {
		$(this).data("editing", "true")
	}).on("blur", function() {
		$(this).data("editing", "false"), $(this).parent().removeClass("error"), $(this).data("error", "false");
		var val = $.trim($(this).val()),
			reMobile = /^1[34578][0-9]{9}$/;
		val ? reMobile.test(val) ? $(this).parent().find("p").remove() : ($(this).parent().addClass("error"), $(this).data("error", "true"), $(this).parent().find("p").remove(), $(this).parent().append("<p>*手机号格式不正确</p>")) : $(this).parent().find("p").remove()
	}), $("#schedule_submit").on("click", function() {
		var $inMobile = $("#schedule_mobile_number"),
			$inPhoneSource = $("#schedule_phone_source"),
			$city = $("#schedule_city");
		if (!$inMobile.val() || "true" === $inMobile.data("error")) return void $inMobile.focus();
		var data = {
			car_id: $(".detail-wrapper").data("id"),
			mobile_number: $.trim($inMobile.val()),
			city: $city.val(),
			phone_source: $inPhoneSource.val()
		};
		$.post("", data, function() {});
		var hours = (new Date).getHours(),
			remind = "<p>稍后我们的工作人员会联系您安排看车时间</p>";
		9 > hours ? remind = "<p>人人车小伙伴还没上班，9点后尽快联系您。</p>" : hours > 18 && (remind = "<p>人人车小伙伴下班啦，明早9点后尽快联系您。</p>"), $("#schedule_modal").find(".form-wrapper").addClass("confirm").html("<h2>恭喜您已经预约成功</h2>" + remind);
		var image = new Image;
		image.src = "/dist/images/transparent-20a1fa37.png?" + $.param(data)
	}), $(".twinkle-dot-block").mouseenter(function() {
		$(this).siblings(".point-popup").children().show(), $(".twinkle-dot-block").css({
			"z-index": 0
		}), $(this).css({
			"z-index": 102
		})
	}).mouseleave(function() {
		$(this).siblings(".point-popup").children().hide(), $(".twinkle-dot-block").css({
			"z-index": 102
		})
	}), $(".defect-index").on("mouseover", function(evt) {
		var target = evt.target,
			id = $(target).data("id");
		$(".defect-index").removeClass("active"), $(target).addClass("active"), $(".defect-gallery img").addClass("hidden"), $(".defect-gallery img").eq(id).removeClass("hidden")
	})
}), require(["jquery", "jquery.lazyload"], function($) {
	$("img.lazy").lazyload({
		threshold: 1e3
	})
}), require(["jquery", "jquery.stickUp"], function($) {
	var offsetTop = 0;
	$("#basic").length > 0 && (offsetTop = $("#basic").offset().top, $(window).scrollTop() > offsetTop && $(".detail-sticky-navbar").fadeIn(100), $(window).scroll(function() {
		$(window).scrollTop() > offsetTop && !$(document.body).data("fullscreen") ? $(".detail-sticky-navbar").fadeIn(100) : $(".detail-sticky-navbar").fadeOut(100)
	}), $(".detail-sticky-navbar").stickUp({
		parts: {
			0: "basic",
			1: "certificate",
			2: "gallery",
			3: "report",
			4: "history",
			5: "parameter"
		},
		itemClass: "menuItem",
		itemHover: "active",
		topMargin: "auto"
	}))
}), require(["jquery", "bootstrap", "jquery.fullscreen", "jquery.owlCarousel"], function($) {
	$(".detail-gallery-slider .slider").on("click", "img", function() {
		function syncPosition() {
			var current = this.currentItem;
			$carousel.find(".owl-item").removeClass("synced").eq(current).addClass("synced"), void 0 !== $carousel.data("owlCarousel") && center(current)
		}
		function center(number) {
			var sync2visible = $carousel.data("owlCarousel").owl.visibleItems,
				num = number,
				found = !1;
			for (var i in sync2visible) if (num === sync2visible[i]) var found = !0;
			found === !1 ? num > sync2visible[sync2visible.length - 1] ? $carousel.trigger("owl.goTo", num - sync2visible.length + 2) : (num - 1 === -1 && (num = 0), $carousel.trigger("owl.goTo", num)) : num === sync2visible[sync2visible.length - 1] ? $carousel.trigger("owl.goTo", sync2visible[1]) : num === sync2visible[0] && $carousel.trigger("owl.goTo", num - 1)
		}
		function loadImage(i) {
			!
			function(i) {
				setTimeout(function() {
					$sliders.eq(i).data("src") && ($sliders.eq(i).attr("src", $sliders.eq(i).data("src")), $sliders.eq(i).data("src", "")), $carousels.eq(i).data("src") && ($carousels.eq(i).attr("src", $carousels.eq(i).data("src")), $carousels.eq(i).data("src", ""))
				}, 0)
			}(i)
		}
		if ($(this).data("src")) {
			$(".detail-sticky-navbar").fadeOut(100), $("#sliderModal").fullscreen({
				backdrop: "static",
				show: !0
			});
			var $slider = $("#slider"),
				$carousel = $("#carousel"),
				$owl = $slider.data("owlCarousel");
			$owl || ($slider.owlCarousel({
				type: "slider",
				margin: 90,
				lazyLoad: !0,
				singleItem: !0,
				navigation: !1,
				pagination: !1,
				slideSpeed: 300,
				rewindSpeed: 1,
				paginationSpeed: 400,
				afterAction: syncPosition,
				responsiveRefreshRate: 200,
				responsiveBaseWidth: "#slider"
			}), $carousel.owlCarousel({
				type: "carousel",
				lazyLoad: !0,
				items: 8,
				itemsDesktop: [1199, 8],
				itemsDesktopSmall: [979, 6],
				itemsTablet: [768, 6],
				itemsMobile: [479, 4],
				pagination: !1,
				rewindSpeed: 1,
				afterInit: function(el) {
					el.find(".owl-item").eq(0).addClass("synced")
				}
			}), $slider.on("click", ".owl-item", function(e) {
				e.preventDefault();
				var $owl = $slider.data("owlCarousel");
				$owl.next()
			}), $carousel.on("click", ".owl-item", function(e) {
				e.preventDefault();
				var number = $(this).data("owlItem");
				$slider.trigger("owl.goTo", number)
			}), $carousel.hover(function() {
				$(this).css("margin-top", "0px"), $(this).find("img").animate({
					height: "80px"
				})
			}, function() {
				$(this).css("margin-top", "74px"), $(this).find("img").animate({
					height: "0px"
				})
			}), $("#nav_prev").on("click", function() {
				var $owl = $slider.data("owlCarousel");
				$owl.prev()
			}), $("#nav_next").on("click", function() {
				var $owl = $slider.data("owlCarousel");
				$owl.next()
			}), $carousel.find(".item").hover(function() {
				var $owl = $slider.data("owlCarousel");
				$owl.goTo($(this).data("id"))
			}));
			var $sliders = $("#sliderModal").find("img.slider-image"),
				$carousels = $("#sliderModal").find("img.carousel-image"),
				len = $sliders.length,
				startAt = $(this).data("start") || 0,
				rangeMax = Math.min(startAt + 4, len),
				rangeMin = Math.max(0, startAt - 3);
			if ($slider.data("owlCarousel").jumpTo(startAt), len >= startAt && startAt >= 0) {
				for (var i = startAt; rangeMax > i; i++) loadImage(i);
				for (var i = startAt - 1; i >= rangeMin; i--) loadImage(i);
				for (var i = rangeMax; len > i; i++) loadImage(i);
				for (var i = 0; rangeMin > i; i++) loadImage(i)
			}
		}
	}), $("#box_installment").on("click", function() {
		$("#installment_modal").fullscreen({
			backdrop: "static",
			show: !0
		})
	})
}), require(["app"], function() {});